1. Field of the Invention
This invention relates generally to methods and apparatus for improving computer performance and more specifically to improve disk input/output performance by combining multiple consecutive read or write requests to a disk drive.
2. Description of the Related Art
The operating system (OS) of a computer is constantly sending read and write commands to a disk driver which in turn sends the commands to the disk. FIG. 1 illustrates block diagram 100 depicting how read and write commands are handled in the prior art. The operating system 102 sends read and write commands to the disk driver 104. The disk driver 104 then sends the commands to storage media 108 and 110 via the bus 106. Each of the read and write commands of FIG. 1 are individually sent to the driver 104 one after the other, upon completion of the preceding command.
For each command being sent to the driver, an interrupt is generated to notify the central processing unit (CPU) it is done processing the command and is ready for the next command. For example, ten read or write commands from the operating system will correspond to ten interrupts being sent to the CPU. For each interrupt the processor must stop its current task and process the commands. Typically, context switching or task switching, where the CPU switches from one context or task to another, is employed to accommodate the interrupts of the CPU so as to make the processing transparent to a user. However, there is a very high cost in terms of performance because of the interrupts and the attention they demand from the CPU. Even for the instances of multiple reads or writes that are contiguous on the disk, separate interrupts are generated for each read or write command, thereby demanding more of the CPU's attention. In addition, under context switching the CPU has to save what it was doing prior to the interrupt so that after processing the interrupt the CPU can return to what it was processing. In other words, the CPU has to flush its pipeline of instructions typically to a special area of random access memory (RAM) called a stack, process the interrupt and then access the RAM to re-fill its pipeline to continue processing as it was prior to the interrupt. The constant interrupts can hog the CPU.
Moreover, the separate commands cause increased mechanical wear on the disk drive system. For example, where multiple commands are received for files or file fragments in the same area of the disk, the disk is required to start and stop multiple times. It should be appreciated that each time the disk starts and stops missed spins result which in turn cause an increase in mechanical stress. More specifically, where 10 commands are issued for the same area of the disk, the disk will start and stop 9 times with each start and stop resulting in a missed spin. Accordingly, the latency and seek times are high due to the superfluous disk rotation.
Yet another drawback of the unnecessary mechanical activity of the disk drive is the wear and tear on the disks and the electromagnetic head. The extra mechanical movements, for example, start stop pulses, work toward decreasing the longevity of the mechanical parts, thereby decreasing the mean time between failure.
Write back cache techniques are currently utilized to enhance performance, however, the techniques employ a buffer where the data is temporarily resident. Thus, the data stays in memory longer and as such is at risk of being lost should the computer crash or shutdown prior to the data being written to disk.
As a result, there is a need to solve the problems of the prior art to improve disk input/output performance by combining multiple consecutive operating system read and write requests to a disk drive into one request with one interrupt without subjecting the data to an increased risk of loss.